package com.chinasoft.tw.service;

import com.chinasoft.tw.pojo.Info;
import com.chinasoft.tw.service.DengChaoBiao.DengChaoBiao;
import com.chinasoft.tw.service.chenruihang.CRH;
import com.chinasoft.tw.service.cxx.ChenXiaoXuan;
import com.chinasoft.tw.service.hzy.HzyTrue;
import com.chinasoft.tw.service.liangQian.LQ;
import com.chinasoft.tw.service.lujiaming.Studentljm;
import com.chinasoft.tw.service.luoxulang.luoxulang;
import com.chinasoft.tw.service.lyh.StudentLyh;
import com.chinasoft.tw.service.lzs.lzs;
import com.chinasoft.tw.service.wcw.Student_wcw;
import com.chinasoft.tw.service.zengjianchao.ZJC;
import com.chinasoft.tw.service.zequan.ZqTrue;
import com.chinasoft.tw.service.zhangwen.ZwTrue;
import com.chinasoft.tw.service.zhoushiting.ZstTrue;
import com.chinasoft.tw.service.zw.StudentOne;
import com.chinasoft.tw.service.zxy.StudentZxy;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Service
public class TrueWordService {
    List<TrueWord> studentList = new ArrayList<>();
    Random random = new Random();

    // 构造方法
    public TrueWordService() {
        TrueWord tw1 = new ZwTrue();
        studentList.add(tw1);
        // 添加其他 同学
        StudentOne tw2 = new StudentOne();
        studentList.add(tw2);

        LQ lq=new LQ();
        studentList.add(lq);

        CRH crh=new CRH();
        studentList.add(crh);

        luoxulang luoxulang=new luoxulang();
        studentList.add(luoxulang);

        StudentLyh lyh=new StudentLyh();
        studentList.add(lyh);

        ChenXiaoXuan cxx=new ChenXiaoXuan();
        studentList.add(cxx);

        ZstTrue zstTrue = new ZstTrue();
        studentList.add(zstTrue);

        ZJC zjc = new ZJC();
        studentList.add(zjc);


        Studentljm ljm=new Studentljm();
        studentList.add(ljm);
        StudentZxy zxy = new StudentZxy();
        studentList.add(zxy);

        ZqTrue zqTrue = new ZqTrue();
        studentList.add(zqTrue);

        lzs lzs1 = new lzs();
        studentList.add(lzs1);

        HzyTrue HzyTrue = new HzyTrue();
        studentList.add(HzyTrue);

        Student_wcw student_wcw = new Student_wcw();
        studentList.add(student_wcw);

        DengChaoBiao dcb=new DengChaoBiao();
        studentList.add(dcb);
    }

    public Info getAllWord() {
        int index = random.nextInt(studentList.size());
        TrueWord tw = studentList.get(index);
        Info info = tw.getTrueWord();
        return info;
    }
}
